package com.example.net.websocket.bean;

import androidx.annotation.IntDef;

import com.alibaba.fastjson.annotation.JSONField;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;


public class CarRequest {
    @IntDef(value = {CarRequestType.REGISTER, CarRequestType.HEART, CarRequestType.LOGIN})
    @Retention(RetentionPolicy.SOURCE)
    public @interface CarRequestType {
        int REGISTER = -1;
        int HEART = 0;
        int LOGIN = 1;
    }

    @JSONField(name = "type")
    private Integer type;
    @JSONField(name = "data")
    private DataDTO data;

    public Integer getType() {
        return type;
    }

    public void setType(@CarRequestType Integer type) {
        this.type = type;
    }

    public DataDTO getData() {
        return data;
    }

    public void setData(DataDTO data) {
        this.data = data;
    }

    public static class DataDTO {
        @JSONField(name = "devid")
        private String devid;

        public String getDevid() {
            return devid;
        }

        public void setDevid(String devid) {
            this.devid = devid;
        }
    }
}
